package com.nbsaas.boot.project.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import com.nbsaas.boot.rest.filter.Operator;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Data;

import java.util.Date;


@Data
@FormAnnotation(title = "出差", model = "出差", menu = "1,88,94")
@Entity
@Table(name = "nb_project_travel")
public class ProjectTravel extends AbstractEntity {

    @FieldName
    @FieldConvert
    @SearchItem(label = "项目", name = "project", key = "project.id", operator = Operator.eq, type = InputType.select)
    @FormField(title = "项目名称", sortNum = "1", grid = true, type = InputType.select, option = "project", required = true, width = "160")
    @ManyToOne(fetch = FetchType.LAZY)
    private Project project;

    @SearchItem(label = "出差地址", name = "address", key = "address")
    @FormField(title = "出差地址", sortNum = "1", grid = true, width = "200")
    private String address;

    @FormField(title = "开始时间", sortNum = "1", grid = true, type = InputType.date, width = "160")
    private Date beginDate;


    @FormField(title = "随行人员", sortNum = "1", grid = true)
    private String followUser;

    @FormField(title = "内容", sortNum = "1", grid = true, width = "1000")
    private String note;

}
